//	DeviceIoControl IOCTL codes supported by PciQa
#ifndef __IOCTL__			
#define __IOCTL__

#define IOCTL_PCIDUMPR_DUMP_PCI_DATA  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD00, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_READ_MEMORY  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD01, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_WRITE_MEMORY  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD02, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_GET_PCI_ADDRESS  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD03, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_BUFFER_READ_MEMORY  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD04, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_BUFFER_WRITE_MEMORY  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD05, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_WRITE_EEPROM  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD06, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_READ_EEPROM  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD07, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_WRITE_BLOCK_EEPROM  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD08, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_READ_BLOCK_EEPROM  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD09, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_PROBE_DMA_DATA  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD0A, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_TRANSFER_DMA_DATA_BUFFER  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD0B, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_TRANSFER_DMA_DESCRIPTOR  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD0C, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_DUMP_DMA  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD0D, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_ERASE_DMA  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD0E, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_START_TX  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD0F, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_START_RX  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD10, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_SNIFFER  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD11, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_COM_WRITE  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD12, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_COM_READ  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD13, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_DMA_4K_BOUNDARY_TEST  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD14, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIDUMPR_GET_FIRMWARE_VERSION  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD15, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_ENABLE_ANTENNA_DIVERSITY  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD16, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_READ_PCI_ConfigSpace  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD17, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_WRITE_PCI_ConfigSpace  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD18, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_QA_SEND_FW_CMD  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD19, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_USBQA_USB_EEPROM_READ  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD24, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_USBQA_USB_EEPROM_WRITE  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD25, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_QA_GET_FW_CMD_RSP  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD1A, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_QA_GET_FWD_SEQNUM  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD1B, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_QA_GET_FWD_STATUS  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD1C, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_QA_GET_PACKETCMD_SEQNUM  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD1D, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_QA_GET_PACKETCMD_RESPONSE  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD1E, METHOD_BUFFERED, FILE_ANY_ACCESS )
    
//-------------------------------------------------------------------------

#define IOCTL_PCIQA_SELECT_CHANNEL \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD60, METHOD_BUFFERED, FILE_ANY_ACCESS )	

#define IOCTL_PCIQA_RF_WRITE  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD61, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIQA_SET_TX_POWER \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD62, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIQA_SET_FREQUENCY_OFFSET \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD63, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIQA_PCI_MAC_MULTI_READ \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD65, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIQA_PCI_MAC_MULTI_WRITE \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD66, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIQA_PCI_EEPROM_READ \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD67, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIQA_PCI_EEPROM_WRITE \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD68, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIQA_PCI_BBP_READ \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD69, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIQA_PCI_BBP_WRITE \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD6a, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIQA_RX_ANTENNA_SELECTED  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD6b, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIQA_TX_ANTENNA_SELECTED  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD6c, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_PCIQA_RF_ANTENNA_SELECTED \
	    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD6d, METHOD_BUFFERED, FILE_ANY_ACCESS )

/////////////////////////////////////////////////////////////////////////////

#define IOCTL_QA_Select_Interface	\
	    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD7F, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_QA_CMD_Send	\
	    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD80, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_QA_CMD_Receive	\
	    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD81, METHOD_BUFFERED, FILE_ANY_ACCESS )
	    
#define IOCTL_QA_Enable_Ready	\
	    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD82, METHOD_BUFFERED, FILE_ANY_ACCESS )

/////////////////////////////////////////////////////////////////////////////

#define IOCTL_ENABLE_BEACON	\
	    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xDb0, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_DISABLE_BEACON	\
	    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xDb1, METHOD_BUFFERED, FILE_ANY_ACCESS )
	    
// set TCP/IP payload
#define IOCTL_SET_TCPIP_PAYLOAD	\
	    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xDb2, METHOD_BUFFERED, FILE_ANY_ACCESS )


//USB
#define BULKUSB_IOCTL_INDEX             0x0000


#define IOCTL_BULKUSB_GET_CONFIG_DESCRIPTOR CTL_CODE(FILE_DEVICE_UNKNOWN,     \
                                                     BULKUSB_IOCTL_INDEX,     \
                                                     METHOD_BUFFERED,         \
                                                     FILE_ANY_ACCESS)
                                                   
#define IOCTL_BULKUSB_RESET_DEVICE          CTL_CODE(FILE_DEVICE_UNKNOWN,     \
                                                     BULKUSB_IOCTL_INDEX + 1, \
                                                     METHOD_BUFFERED,         \
                                                     FILE_ANY_ACCESS)

#define IOCTL_BULKUSB_RESET_PIPE            CTL_CODE(FILE_DEVICE_UNKNOWN,     \
                                                     BULKUSB_IOCTL_INDEX + 2, \
                                                     METHOD_BUFFERED,         \
                                                     FILE_ANY_ACCESS)

#define IOCTL_USBQA_USB_MAC_READ_LONG  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD20, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_USBQA_USB_MAC_READ_LONG63  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD63, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_USBQA_USB_MAC_READ_LONG47  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD47, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_USBQA_USB_MAC_WRITE_LONG  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD21, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_USBQA_USB_MAC_WRITE_LONG66  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD66, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_USBQA_SETUP_BULK_OUT_PACKET  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD93, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_USBQA_START_BULK_OUT  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD94, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_USBQA_STOP_TX  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD92, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_USBQA_START_RX0  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD98, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_USBQA_STOP_RX0  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xD99, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_USBQA_START_RX1  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xDa0, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_USBQA_STOP_RX1  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xDa1, METHOD_BUFFERED, FILE_ANY_ACCESS )


//Common USB and PCIe
#define IOCTL_HAL_CMD  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xDa2, METHOD_BUFFERED, FILE_ANY_ACCESS )

//EEPROM or buffer bin or eFuse data
#define IOCTL_WRITE_EEPROM_BUFFER  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xDa3, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_SET_EFUSE_MODE \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xDa4, METHOD_BUFFERED, FILE_ANY_ACCESS )

#define IOCTL_RESET_TXRX_COUNTER \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xDa5, METHOD_BUFFERED, FILE_ANY_ACCESS )

//Write FW
#define IOCTL_WRITE_FW  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xDa6, METHOD_BUFFERED, FILE_ANY_ACCESS )

//Clear FW
#define IOCTL_CLEAR_FW  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xDa7, METHOD_BUFFERED, FILE_ANY_ACCESS )

//Download FW
#define IOCTL_DOWNLOAD_FW  \
    CTL_CODE( FILE_DEVICE_UNKNOWN, 0xDa8, METHOD_BUFFERED, FILE_ANY_ACCESS )



typedef unsigned int UINT32;
typedef signed int INT32;
typedef unsigned char BOOLEAN;
typedef unsigned short UINT16;
typedef unsigned char UCHAR;

typedef struct _OTHER_STATISTICS {
	UINT32					TxRepeatCount;
	UINT32					TransmittedCount;
	UINT32					Rx0ReceivedCount;
	UINT32					ReceivedCount;//++werner //loopback receive count
	UINT32					Ac0TxedCount;
	UINT32					Ac1TxedCount;
	UINT32					Ac2TxedCount;
	UINT32					Ac3TxedCount;
	UINT32					Ac4TxedCount;
	UINT32					Ac5TxedCount;
	UINT32					Ac6TxedCount;
	UINT32					Ac7TxedCount;
	UINT32					Ac8TxedCount;
	UINT32					Ac9TxedCount;
	UINT32					Ac10TxedCount;
	UINT32					Ac11TxedCount;	
	UINT32					MgmtTxedCount;
	UINT32					HccaTxedCount;
	INT32					RSSI0;
	INT32					RSSI1;
	INT32					RSSI2;
	INT32					SNR0;
	INT32					SNR1;
	INT32					SNR2;
	UINT32					UdpErr;
	UINT32					TcpErr;
	UINT32					IpErr;
	INT32					RCPI0;
	INT32					RCPI1;
	INT32					FreqOffstFromRX;
	INT32					TXPower;
	INT32					TSSI;
} OTHER_STATISTICS, *POTHER_STATISTICS;

typedef struct _COUNTER_802_11 {
	LARGE_INTEGER   CRCErrorCount;
	LARGE_INTEGER   RXOverFlowCount;
	LARGE_INTEGER   PHYErrorCount;
	LARGE_INTEGER   FalseCCACount;
	LARGE_INTEGER   U2MDataCount;
	LARGE_INTEGER   OtherDataCount;
	LARGE_INTEGER   BeaconCount;
	LARGE_INTEGER   othersCount;	
	LARGE_INTEGER   ErrorIdx;
} COUNTER_802_11, *PCOUNTER_802_11;
#endif
